home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 145 / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan).7z / Gekkan Dennou Club - 2000.6 Vol. 145 (Japan) (Track 1).bin / games / spassion / source.lzh / SOURCE / BGPUT.C < prev    next >
Text File  |  2000-03-25  |  1KB  |  63 lines

  1. /*
  2.  *        bgput.c( BG character&string output rountine )
  3.  */
  4.  
  5. /*#include <iocslib.h>*/
  6. #include <XSP2lib.H>
  7. #include "SPASSION.H"
  8. #include "BG.H"
  9.  
  10.  
  11. /*
  12.  *    文字列を表示する
  13.  */
  14. void    PutBGStr( short x, short y, char *cp, short info )
  15. {
  16.     while( *cp != '\0' ) {
  17.         xsp_set( x+16 , y+16 , obj_moji+(*cp++)-0x20 , info );
  18.         x+=16;
  19.     }
  20. }
  21. /*
  22.  *    連続するキャラクタを表示する
  23.  */
  24. void    PutBGChar( short x, short y, short *pt, short info )
  25. {
  26.     while( *pt != -1 ) {
  27.         xsp_set( x+16 , y+16 , obj_moji+*pt++ , info );
  28.         x+=16;
  29.     }
  30. }
  31.  
  32. /*
  33.  *    PutBGVal0( page, x, y, color, num, keta )
  34.  *     スプライトで num を keta で指定された桁数で右詰め表示する
  35.  *                足りない部分は0で埋まる
  36.  *
  37.  *    short    x;            X座標
  38.  *    short    y;            Y座標
  39.  *    int        num;        表示する数
  40.  *    short    keta;        桁数
  41.  *    short    info;        色、反転
  42.  */
  43.  
  44. void    PutBGVal0(short x, short y, int num, short keta, short info )
  45. {
  46.     keta--;
  47.     do{
  48.         xsp_set( x+keta*16+16 , y+16 , obj_moji+(num % 10)+0x10 , info );
  49.         num /= 10;
  50.     }while( --keta >= 0 ) ;
  51. /*    }while( (num > 0) && (--keta >= 0) );*/        /* 0で埋めない */
  52. }
  53.  
  54. /* PutBGVal0 の8ドット版*/
  55. void    PutBGVal8(short x, short y, int num, short keta, short info )
  56. {
  57.     keta--;
  58.     do{
  59.         xsp_set( x+keta*8+16 , y+16 , obj_moji+(num % 10)+0x70 , info );
  60.         num /= 10;
  61.     }while( --keta >= 0 );
  62. }
  63.